127 research outputs found

    On Near-Linear-Time Algorithms for Dense Subset Sum

    Get PDF
    In the Subset Sum problem we are given a set of nn positive integers XX and a target tt and are asked whether some subset of XX sums to tt. Natural parameters for this problem that have been studied in the literature are nn and tt as well as the maximum input number mxX\rm{mx}_X and the sum of all input numbers ΣX\Sigma_X. In this paper we study the dense case of Subset Sum, where all these parameters are polynomial in nn. In this regime, standard pseudo-polynomial algorithms solve Subset Sum in polynomial time nO(1)n^{O(1)}. Our main question is: When can dense Subset Sum be solved in near-linear time O~(n)\tilde{O}(n)? We provide an essentially complete dichotomy by designing improved algorithms and proving conditional lower bounds, thereby determining essentially all settings of the parameters n,t,mxX,ΣXn,t,\rm{mx}_X,\Sigma_X for which dense Subset Sum is in time O~(n)\tilde{O}(n). For notational convenience we assume without loss of generality that tmxXt \ge \rm{mx}_X (as larger numbers can be ignored) and tΣX/2t \le \Sigma_X/2 (using symmetry). Then our dichotomy reads as follows: - By reviving and improving an additive-combinatorics-based approach by Galil and Margalit [SICOMP'91], we show that Subset Sum is in near-linear time O~(n)\tilde{O}(n) if tmxXΣX/n2t \gg \rm{mx}_X \Sigma_X/n^2. - We prove a matching conditional lower bound: If Subset Sum is in near-linear time for any setting with tmxXΣX/n2t \ll \rm{mx}_X \Sigma_X/n^2, then the Strong Exponential Time Hypothesis and the Strong k-Sum Hypothesis fail. We also generalize our algorithm from sets to multi-sets, albeit with non-matching upper and lower bounds

    Faster Approximate Pattern Matching: {A} Unified Approach

    Get PDF
    Approximate pattern matching is a natural and well-studied problem on strings: Given a text TT, a pattern PP, and a threshold kk, find (the starting positions of) all substrings of TT that are at distance at most kk from PP. We consider the two most fundamental string metrics: the Hamming distance and the edit distance. Under the Hamming distance, we search for substrings of TT that have at most kk mismatches with PP, while under the edit distance, we search for substrings of TT that can be transformed to PP with at most kk edits. Exact occurrences of PP in TT have a very simple structure: If we assume for simplicity that T3P/2|T| \le 3|P|/2 and trim TT so that PP occurs both as a prefix and as a suffix of TT, then both PP and TT are periodic with a common period. However, an analogous characterization for the structure of occurrences with up to kk mismatches was proved only recently by Bringmann et al. [SODA'19]: Either there are O(k2)O(k^2) kk-mismatch occurrences of PP in TT, or both PP and TT are at Hamming distance O(k)O(k) from strings with a common period O(m/k)O(m/k). We tighten this characterization by showing that there are O(k)O(k) kk-mismatch occurrences in the case when the pattern is not (approximately) periodic, and we lift it to the edit distance setting, where we tightly bound the number of kk-edit occurrences by O(k2)O(k^2) in the non-periodic case. Our proofs are constructive and let us obtain a unified framework for approximate pattern matching for both considered distances. We showcase the generality of our framework with results for the fully-compressed setting (where TT and PP are given as a straight-line program) and for the dynamic setting (where we extend a data structure of Gawrychowski et al. [SODA'18])

    Faster Pattern Matching under Edit Distance

    Get PDF
    We consider the approximate pattern matching problem under the edit distance.Given a text TT of length nn, a pattern PP of length mm, and a thresholdkk, the task is to find the starting positions of all substrings of TT thatcan be transformed to PP with at most kk edits. More than 20 years ago, Coleand Hariharan [SODA'98, J. Comput.'02] gave an O(n+k4n/m)\mathcal{O}(n+k^4 \cdot n/m)-time algorithm for this classic problem, and this runtime has not beenimproved since. Here, we present an algorithm that runs in time O(n+k3.5logmlogkn/m)\mathcal{O}(n+k^{3.5}\sqrt{\log m \log k} \cdot n/m), thus breaking through this long-standingbarrier. In the case where n^{1/4+\varepsilon} \leq k \leqn^{2/5-\varepsilon} for some arbitrarily small positive constantε\varepsilon, our algorithm improves over the state-of-the-art by polynomialfactors: it is polynomially faster than both the algorithm of Cole andHariharan and the classic O(kn)\mathcal{O}(kn)-time algorithm of Landau andVishkin [STOC'86, J. Algorithms'89]. We observe that the bottleneck case of the alternative O(n+k4n/m)\mathcal{O}(n+k^4\cdot n/m)-time algorithm of Charalampopoulos, Kociumaka, and Wellnitz[FOCS'20] is when the text and the pattern are (almost) periodic. Our newalgorithm reduces this case to a new dynamic problem (Dynamic Puzzle Matching),which we solve by building on tools developed by Tiskin [SODA'10,Algorithmica'15] for the so-called seaweed monoid of permutation matrices. Ouralgorithm relies only on a small set of primitive operations on strings andthus also applies to the fully-compressed setting (where text and pattern aregiven as straight-line programs) and to the dynamic setting (where we maintaina collection of strings under creation, splitting, and concatenation),improving over the state of the art.<br

    Detecting and counting small subgraphs, and evaluating a parameterized Tutte polynomial: lower bounds via toroidal grids and Cayley graph expanders

    Get PDF
    Given a graph property Φ\Phi, we consider the problem EdgeSub(Φ)\mathtt{EdgeSub}(\Phi), where the input is a pair of a graph GG and a positive integer kk, and the task is to decide whether GG contains a kk-edge subgraph that satisfies Φ\Phi. Specifically, we study the parameterized complexity of EdgeSub(Φ)\mathtt{EdgeSub}(\Phi) and of its counting problem #EdgeSub(Φ)\#\mathtt{EdgeSub}(\Phi) with respect to both approximate and exact counting. We obtain a complete picture for minor-closed properties Φ\Phi: the decision problem EdgeSub(Φ)\mathtt{EdgeSub}(\Phi) always admits an FPT algorithm and the counting problem #EdgeSub(Φ)\#\mathtt{EdgeSub}(\Phi) always admits an FPTRAS. For exact counting, we present an exhaustive and explicit criterion on the property Φ\Phi which, if satisfied, yields fixed-parameter tractability and otherwise #W[1]\#\mathsf{W[1]}-hardness. Additionally, most of our hardness results come with an almost tight conditional lower bound under the so-called Exponential Time Hypothesis, ruling out algorithms for #EdgeSub(Φ)\#\mathtt{EdgeSub}(\Phi) that run in time f(k)Go(k/logk)f(k)\cdot|G|^{o(k/\log k)} for any computable function ff. As a main technical result, we gain a complete understanding of the coefficients of toroidal grids and selected Cayley graph expanders in the homomorphism basis of #EdgeSub(Φ)\#\mathtt{EdgeSub}(\Phi). This allows us to establish hardness of exact counting using the Complexity Monotonicity framework due to Curticapean, Dell and Marx (STOC'17). Our methods can also be applied to a parameterized variant of the Tutte Polynomial TGkT^k_G of a graph GG, to which many known combinatorial interpretations of values of the (classical) Tutte Polynomial can be extended. As an example, TGk(2,1)T^k_G(2,1) corresponds to the number of kk-forests in the graph GG. Our techniques allow us to completely understand the parametrized complexity of computing the evaluation of TGkT^k_G at every pair of rational coordinates (x,y)(x,y)

    Counting small induced subgraphs satisfying monotone properties

    Get PDF
    Given a graph property Φ\Phi, the problem #IndSub(Φ)\#\mathsf{IndSub}(\Phi) asks, on input a graph GG and a positive integer kk, to compute the number of induced subgraphs of size kk in GG that satisfy Φ\Phi. The search for explicit criteria on Φ\Phi ensuring that #IndSub(Φ)\#\mathsf{IndSub}(\Phi) is hard was initiated by Jerrum and Meeks [J. Comput. Syst. Sci. 15] and is part of the major line of research on counting small patterns in graphs. However, apart from an implicit result due to Curticapean, Dell and Marx [STOC 17] proving that a full classification into "easy" and "hard" properties is possible and some partial results on edge-monotone properties due to Meeks [Discret. Appl. Math. 16] and D\"orfler et al. [MFCS 19], not much is known. In this work, we fully answer and explicitly classify the case of monotone, that is subgraph-closed, properties: We show that for any non-trivial monotone property Φ\Phi, the problem #IndSub(Φ)\#\mathsf{IndSub}(\Phi) cannot be solved in time f(k)V(G)o(k/log1/2(k))f(k)\cdot |V(G)|^{o(k/ {\log^{1/2}(k)})} for any function ff, unless the Exponential Time Hypothesis fails. By this, we establish that any significant improvement over the brute-force approach is unlikely; in the language of parameterized complexity, we also obtain a #W[1]\#\mathsf{W}[1]-completeness result

    Counting small induced subgraphs satisfying monotone properties

    Get PDF
    Given a graph property Φ\Phi, the problem #IndSub(Φ)\#\mathsf{IndSub}(\Phi) asks, on input a graph GG and a positive integer kk, to compute the number of induced subgraphs of size kk in GG that satisfy Φ\Phi. The search for explicit criteria on Φ\Phi ensuring that #IndSub(Φ)\#\mathsf{IndSub}(\Phi) is hard was initiated by Jerrum and Meeks [J. Comput. Syst. Sci. 15] and is part of the major line of research on counting small patterns in graphs. However, apart from an implicit result due to Curticapean, Dell and Marx [STOC 17] proving that a full classification into "easy" and "hard" properties is possible and some partial results on edge-monotone properties due to Meeks [Discret. Appl. Math. 16] and D\"orfler et al. [MFCS 19], not much is known. In this work, we fully answer and explicitly classify the case of monotone, that is subgraph-closed, properties: We show that for any non-trivial monotone property Φ\Phi, the problem #IndSub(Φ)\#\mathsf{IndSub}(\Phi) cannot be solved in time f(k)V(G)o(k/log1/2(k))f(k)\cdot |V(G)|^{o(k/ {\log^{1/2}(k)})} for any function ff, unless the Exponential Time Hypothesis fails. By this, we establish that any significant improvement over the brute-force approach is unlikely; in the language of parameterized complexity, we also obtain a #W[1]\#\mathsf{W}[1]-completeness result

    Counting Small Induced Subgraphs Satisfying Monotone Properties

    Get PDF
    Given a graph property Φ\Phi, the problem #IndSub(Φ)\#\mathsf{IndSub}(\Phi) asks, on input a graph GG and a positive integer kk, to compute the number of induced subgraphs of size kk in GG that satisfy Φ\Phi. The search for explicit criteria on Φ\Phi ensuring that #IndSub(Φ)\#\mathsf{IndSub}(\Phi) is hard was initiated by Jerrum and Meeks [J. Comput. Syst. Sci. 15] and is part of the major line of research on counting small patterns in graphs. However, apart from an implicit result due to Curticapean, Dell and Marx [STOC 17] proving that a full classification into "easy" and "hard" properties is possible and some partial results on edge-monotone properties due to Meeks [Discret. Appl. Math. 16] and D\"orfler et al. [MFCS 19], not much is known. In this work, we fully answer and explicitly classify the case of monotone, that is subgraph-closed, properties: We show that for any non-trivial monotone property Φ\Phi, the problem #IndSub(Φ)\#\mathsf{IndSub}(\Phi) cannot be solved in time f(k)V(G)o(k/log1/2(k))f(k)\cdot |V(G)|^{o(k/ {\log^{1/2}(k)})} for any function ff, unless the Exponential Time Hypothesis fails. By this, we establish that any significant improvement over the brute-force approach is unlikely; in the language of parameterized complexity, we also obtain a #W[1]\#\mathsf{W}[1]-completeness result

    Counting Induced Subgraphs: {A}n Algebraic Approach to \#{W}[1]-hardness

    Get PDF

    Faster pattern matching under edit distance : a reduction to dynamic puzzle matching and the Seaweed Monoid of permutation matrices

    Get PDF
    We consider the approximate pattern matching problem under the edit distance. Given a text T of length n, a pattern P of length m, and a threshold k, the task is to find the starting positions of all substrings of T that can be transformed to P with at most k edits. More than 20 years ago, Cole and Hariharan [SODA’98, J. Comput.’02] gave an O(n + k^4·n/m)-time algorithm for this classic problem, and this runtime has not been improved since. Here, we present an algorithm that runs in time O(n + k^{3.5}√( log m log k) · n/m), thus breaking through this longstanding barrier. In the case where n^{1/4+ε} ≤ k ≤ n^{2/5−ε} for some arbitrarily small positive constant ε, our algorithm improves over the state-of-the-art by polynomial factors: it is polynomially faster than both the algorithm of Cole and Hariharan and the classic O(kn)-time algorithm of Landau and Vishkin [STOC’86, J. Algorithms’89]. We observe that the bottleneck case of the alternative O(n + k^4· n/m)-time algorithm of Charalampopoulos, Kociumaka, and Wellnitz [FOCS’20] is when the text and the pattern are (almost) periodic. Our new algorithm reduces this case to a new Dynamic Puzzle Matching problem, which we solve by building on tools developed by Tiskin [SODA’10, Algorithmica’15] for the so called seaweed monoid of permutation matrices. Our algorithm relies only on a small set of primitive operations on strings and thus also applies to the fully-compressed setting (where text and pattern are given as straight-line programs) and to the dynamic setting (where we maintain a collection of strings under creation, splitting, and concatenation), improving over the state of the art

    Acute phase reaction to LPS induced mastitis in early lactation dairy cows fed nitrogenic, glucogenic or lipogenic diets.

    Get PDF
    The availability of certain macronutrients is likely to influence the capacity of the immune system. Therefore, we investigated the acute phase response to intramammary (i.mam.) LPS in dairy cows fed either a nitrogenic diet (n = 10) high in crude protein, a glucogenic diet (n = 11) high in carbohydrates and glucogenic precursors, or a lipogenic diet (n = 11) high in lipids. Thirty-two dairy cows were fed one of the dietary concentrates directly after calving until the end of trial at 27 ± 3 DIM (mean ± SD). In wk 3 of lactation, 20 µg of LPS was i.mam. injected in one quarter, and sterile NaCl (0.9%) in the contralateral quarter. Milk samples of the LPS challenged and control quarter were taken hourly from before (0 h) until 9 h after LPS challenge, and analyzed for milk amyloid A (MAA), haptoglobin (Hp), and IL-8. In addition, blood samples were taken in the morning, and composite milk samples at morning and evening milkings from 1 d before until 3 d after LPS challenge, and again on d 9 to determine serum amyloid A (SAA) and Hp in blood, and MAA and Hp in milk. The mRNA abundance of various immunological and metabolic factors in blood leukocytes was quantified by RT-qPCR from samples taken at -18 h, -1 h, 6 h, 9 h and 23 h relative to LPS application. The dietary concentrates did not affect any of the parameters in blood, milk, and leukocytes. The IL-8 was increased from 2 h, Hp from 2 to 3 h, and MAA from 6 h relative to the LPS administration in the milk of the challenged quarter and remained elevated until 9 h. The MAA and Hp were also increased at 9 h after LPS challenge in whole udder composite milk, whereas Hp and SAA in blood were increased only after 23 h. All 4 parameters were decreased again on d 9. Similar for all groups, the mRNA abundance of Hp and the heat shock protein family A (HSP70) increased after the LPS challenge, while the mRNA expression of the tumor necrosis factor α (TNF) and the leukocyte integrin β 2 subunit (CD18) were decreased at 6 h after LPS challenge. The glucose transporter (GLUT)1 mRNA abundance decreased after LPS, whereas that of the GLUT3 increased, and that of the GLUT4 was not detectable. The mRNA abundance of GAPDH was increased at 9 h after LPS and remained elevated. The APP response was detected earlier in milk compared with blood indicating mammary production. However, immunological responses to LPS were not affected by the availability of specific macronutrients provided by the different diets
    corecore